#include <handm.h>
#include <stdio.h>
#include <json/json.h>
#include <iostream>
#include <fstream>
#include <typeinfo>
#include <string.h>
#include <Eigen/Dense>
#include "ceres/ceres.h"
#include "pose_to_transforms.h"
// #include<igl/cat.h>
// #include<igl/matlab/MatlabWorkspace.h>

namespace smpl{
    const int HandModel::NUM_SHAPE_COEFFICIENTS;
    const int HandModel::NUM_VERTICES;
    const int HandModel::NUM_JOINTS;
    const int HandModel::NUM_POSE_PARAMETERS;



template<typename Derived, int rows, int cols>
void initMatrix(Eigen::Matrix<Derived, rows, cols>& m, const Json::Value& value)
{
    if(m.cols() == 1) { // a vector
        m.resize(value.size(), 1);
        for (uint i = 0; i < value.size(); i++)
        {
            if (strcmp(typeid(Derived).name(), "i") == 0) // the passed in matrix is Int
                m(i, 0) = value[i].asInt();
            else // the passed in matrix is should be double
                m(i, 0) = value[i].asDouble();
        }
    }
    else  { // a matrix
        m.resize(value.size(), value[0u].size());
        for (uint i = 0; i < value.size(); i++)
            for (uint j = 0; j < value[i].size(); j++)
            {
                if (strcmp(typeid(Derived).name(), "i") == 0)
                    m(i, j) = value[i][j].asInt();
                else
                    m(i, j) = value[i][j].asDouble();
            }
    }
    // std::cout << m << std::endl;
}

template<typename Derived, int rows, int cols, int option>
void initMatrixRowMajor(Eigen::Matrix<Derived, rows, cols, option>& m, const Json::Value& value)
{
    if(m.cols() == 1) { // a vector
        m.resize(value.size(), 1);
        for (uint i = 0; i < value.size(); i++)
        {
            if (strcmp(typeid(Derived).name(), "i") == 0) // the passed in matrix is Int
                m(i, 0) = value[i].asInt();
            else // the passed in matrix is should be double
                m(i, 0) = value[i].asDouble();
        }
    }
    else  { // a matrix
        m.resize(value.size(), value[0u].size());
        for (uint i = 0; i < value.size(); i++)
            for (uint j = 0; j < value[i].size(); j++)
            {
                if (strcmp(typeid(Derived).name(), "i") == 0)
                    m(i, j) = value[i][j].asInt();
                else
                    m(i, j) = value[i][j].asDouble();
            }
    }
    // std::cout << m << std::endl;
}

template<typename Derived, int option>
void initSparseMatrix(Eigen::SparseMatrix<Derived, option>& m, const Json::Value& value)
{
    if (strcmp(typeid(Derived).name(), "i") == 0)
    {
        // The first row specifies the size of the sparse matrix
        m.resize(value[0u][0u].asInt(), value[0u][1u].asInt());
        for (uint k = 1u; k < value.size(); k++)
        {
            assert(value[k].size() == 3);
            // From the second row on, triplet correspond to matrix entries
            const int i = value[k][0u].asInt();
            const int j = value[k][1u].asInt();
            m.insert(i, j) = value[k][2u].asInt();
        }
    }
    else
    {
        // The first row specifies the size of the sparse matrix
        m.resize(value[0u][0u].asInt(), value[0u][1u].asInt());
        for (uint k = 1u; k < value.size(); k++)
        {
            assert(value[k].size() == 3);
            // From the second row on, triplet correspond to matrix entries
            const int i = value[k][0u].asInt();
            const int j = value[k][1u].asInt();
            m.insert(i, j) = value[k][2u].asDouble();
        }
    }
    std::cout << "rows " << m.rows() << " cols " << m.cols() << std::endl;
}

void LoadHandModelFromJson( HandModel &handm, const std::string &path ) 
{
    printf("Loading from: %s\n", path.c_str());
    Json::Value root;
    std::ifstream file(path.c_str(), std::ifstream::in);
    file >> root;
    initMatrix(handm.update_inds_, root["update_inds"]);
    initMatrix(handm.parents_, root["parents"]);
    initMatrix(handm.m_jointmap_pm2model, root["joint_order"]);
    initMatrix(handm.pose_limits_, root["pose_limits"]);
    initMatrix(handm.coeffs_limits_, root["coeffs_limits"]);
    initMatrixRowMajor(handm.m_M_l2pl, root["MTa"]);
    initMatrixRowMajor(handm.m_M_w2l, root["MTi"]);
    // initMatrix(handm.pose_prior_A_, root["pose_prior_A"]);
    // initMatrix(handm.pose_prior_mu_, root["pose_prior_mu"]);
    initMatrix(handm.coeffs_prior_A_, root["coeffs_prior_A"]);
    initMatrix(handm.coeffs_prior_mu_, root["coeffs_prior_mu"]);
    initMatrixRowMajor(handm.V_, root["V"]);
    // initMatrixRowMajor(handm.m_T_hand2smpl, root["T_hand2smpl"]);
    int handRootJoint = handm.update_inds_(0);
    handm.m_M_rootlocal2smplW = handm.m_T_hand2smpl * handm.m_M_w2l.block(handRootJoint * 4, 0, 4, 4).inverse(); //Precomputing.
    initMatrix(handm.uv, root["texcoord"]);
    initMatrix(handm.W_, root["W"]);
    Eigen::Matrix<double, Eigen::Dynamic, 4> F_quad;
    initMatrix(F_quad, root["F"]);
    handm.F_ = Eigen::Matrix<double, Eigen::Dynamic, 3>(F_quad.rows()*2, 3);
    initSparseMatrix(handm.STB_wrist_reg, root["regressor_hand_wrist_zerobased"]);
    handm.STB_wrist_reg.makeCompressed();

    handm.pose_prior_mu_.resize(60);
    handm.pose_prior_mu_ <<
        -1.89476531e-01,  2.93358193e-03, -3.01692798e-01, -7.63309729e-02,
        -3.04809155e-02, -6.72166224e-02, -3.23258270e-02, -2.44036839e-02,
        -3.80976097e-02,  0.00000000e+00,  0.00000000e+00,  0.00000000e+00,
        -2.44791279e-02, -1.23432229e-01, -2.06133311e-01,  0.00000000e+00,
         0.00000000e+00,  0.00000000e+00,  1.26004516e-01, -3.83345400e-02,
        -2.40782403e-01,  0.00000000e+00,  0.00000000e+00,  0.00000000e+00,
         1.10459034e-01, -2.68768763e-02, -4.51549950e-01,  0.00000000e+00,
         0.00000000e+00,  0.00000000e+00,  7.17272537e-02,  4.65289425e-02,
        -4.94940601e-01,  0.00000000e+00,  0.00000000e+00,  0.00000000e+00,
         4.69323519e-04, -7.88688846e-02, -3.82274740e-01,  1.56258409e-02,
        -3.63317838e-02, -2.50612071e-01,  7.85818191e-02,  7.76905369e-02,
        -3.73419342e-01,  4.05758386e-02,  5.37697222e-02, -2.49972659e-01,
         6.15348618e-02,  5.44238906e-02, -3.78617498e-01,  4.31994123e-02,
         3.04211584e-02, -1.79873274e-01,  3.86346240e-02,  3.07679692e-02,
        -3.06715730e-01,  2.43519139e-02,  1.26407784e-02, -1.50080095e-01;
    double A_data[3600] = {    
3.7857e+01, -3.1693e+00, -3.8536e+00, -1.8891e+01, 3.3058e+00, 3.3026e+00, 1.0766e+01, 5.5505e-02, -2.7288e+00, -3.4155e-13, -2.8118e-13, -8.8010e-14, 2.6564e-02, 1.4212e-01, -1.4377e+00, -1.6855e-16, -7.6728e-14, -4.1752e-14, 1.1009e+00, 1.2368e+00, -1.6304e+00, -9.3574e-15, 3.1064e-14, -3.2107e-14, 2.8511e+00, 6.1671e-01, -1.0517e+00, 1.3871e-14, 4.0393e-15, -6.9761e-15, 7.5163e-01, 2.1607e+00, -7.7284e-01, 5.1297e-15, -3.9512e-16, 4.1885e-15, -2.5202e+00, 1.7349e+00, 7.2543e-01, 2.5301e+00, -4.1914e+00, -6.2502e-03, -1.1810e+00, -3.8859e-01, 1.4241e+00, 2.5736e+00, 2.0487e+00, -9.4984e-01, -1.8371e+00, 1.6767e-01, 2.6604e-01, 1.1583e+00, -8.2186e-01, 8.4512e-01, -2.9931e+00, -1.9736e+00, 6.6066e-02, 1.6736e+00, 6.4586e-01, 2.3043e-01,
-3.1693e+00, 1.2047e+01, -3.0287e+00, -3.2867e-01, -1.1911e+01, 3.2224e+00, -4.9331e-01, 7.2677e+00, -4.3116e+00, 1.2566e-15, 7.2787e-14, 2.6409e-14, 3.7156e-02, 8.4919e-02, 4.8427e-01, 2.5222e-14, -8.5078e-15, 2.2614e-14, 7.4729e-01, 5.8689e-01, 1.1890e+00, 1.9069e-14, -3.7319e-15, 5.7847e-15, 8.1236e-01, 5.3561e-01, 3.0761e-01, 1.1483e-16, 1.4459e-15, -2.6234e-15, 8.1164e-01, 6.4821e-01, -2.2419e-01, 1.8607e-16, -7.1289e-16, 4.3323e-15, 1.0047e+00, -3.9160e-01, 1.4094e-01, -1.4642e+00, -1.4842e+00, -9.4781e-01, -1.5654e+00, 3.5418e-01, -1.1946e+00, 7.7188e-01, -9.2898e-02, 6.3221e-01, 1.8576e-01, -4.5611e-01, 1.3418e-01, 2.0263e-01, 1.9791e-01, -3.8049e-01, 5.7522e-01, -6.1104e-01, 1.4797e-01, 7.4774e-01, 4.7357e-01, 5.5484e-01,
-3.8536e+00, -3.0287e+00, 1.0081e+01, -3.3104e+00, 3.5556e+00, -7.0098e+00, 3.0171e-01, -3.0530e+00, 6.4475e+00, -3.5071e-14, -8.2296e-14, -1.3326e-14, 2.1025e+00, -1.6259e+00, 4.5602e-01, 5.9269e-15, 3.5903e-15, -1.0294e-14, 1.4610e+00, -1.5596e+00, 2.6867e-01, 7.2289e-16, 1.3431e-15, -6.5657e-15, 1.6838e+00, -1.8416e+00, -7.0508e-01, 3.1093e-15, 1.2370e-15, -1.0656e-15, 3.1642e+00, -1.7176e+00, -1.2537e+00, 1.4256e-15, -1.5599e-16, -1.7868e-15, -1.4920e+00, 8.9271e-01, -9.4193e-01, -1.7198e-01, 1.7615e+00, 8.7479e-01, -3.8160e-01, 1.6542e+00, 2.9958e-02, 1.0322e+00, -4.1417e-01, -3.7659e-02, 2.2803e-01, 1.2132e+00, 4.4190e-01, -3.8343e-01, -9.0716e-01, 5.7897e-01, -1.3704e+00, 1.6395e+00, 8.7381e-01, 9.7396e-01, 6.6805e-01, 1.1400e-01,
-1.8891e+01, -3.2867e-01, -3.3104e+00, 6.7230e+01, -2.8452e+00, 7.6421e-02, -3.9522e+01, 5.7599e+00, 9.3143e-01, 9.3907e-13, 7.3412e-13, 2.0520e-13, -1.1486e+01, 8.6966e-01, 4.3537e-01, 1.3786e-14, 2.2662e-13, 1.5814e-13, 6.0401e+00, -7.5754e-01, -6.3324e-01, 2.1604e-14, -8.5799e-14, 8.9765e-14, -2.3640e+00, -7.3847e-01, 9.0211e-01, -3.1774e-14, -2.2787e-14, 1.8193e-14, 5.3366e+00, -1.3070e+00, 4.3130e-01, -1.0596e-14, 1.7683e-15, -4.4705e-15, 9.0895e+00, -5.5899e+00, 4.2536e-01, 2.2492e+00, 1.7430e+00, -9.3428e-01, 3.0059e+00, 3.5036e-01, -4.8784e-01, -8.8257e+00, 2.2955e+00, 9.2968e-01, 1.0682e-01, -3.0969e+00, -1.6943e-01, 3.7660e+00, 9.9667e-01, -2.3564e-01, -4.2039e+00, 3.4327e+00, 1.9456e-01, -5.3430e+00, 1.9451e-01, -1.7848e-01,
3.3058e+00, -1.1911e+01, 3.5556e+00, -2.8452e+00, 2.6631e+01, -4.8840e+00, -3.6635e+00, -1.7297e+01, 5.5958e+00, -3.7909e-15, -1.5814e-13, -4.3610e-14, 1.9885e+00, -1.1598e+00, -1.3751e+00, -2.6628e-14, 2.1329e-14, -3.3574e-14, 1.4583e+00, -6.9527e-01, -5.8145e-01, -2.2431e-14, 3.7984e-15, -1.3638e-14, 3.4383e-01, -1.5925e-01, 2.0414e-01, 3.0283e-15, -1.7930e-15, 2.9718e-15, 1.4458e+00, -4.7239e-01, 1.0456e-01, 2.1256e-15, 6.5410e-16, -7.9111e-15, -2.2820e+00, -6.7358e-01, -1.7777e-01, 3.0886e+00, 3.4050e+00, 1.1819e+00, 1.6923e+00, -1.5579e-02, 8.0878e-01, -3.8221e-01, 1.1457e+00, 7.2373e-02, 2.4087e-02, 8.9809e-01, 1.5435e-02, -4.5310e-01, 4.6480e-01, 3.9994e-01, 1.2377e-01, 1.2787e+00, -1.8316e-01, 2.3179e-01, -1.0570e+00, 3.2552e-01,
3.3026e+00, 3.2224e+00, -7.0098e+00, 7.6421e-02, -4.8840e+00, 1.6803e+01, 8.4495e-02, 2.9697e+00, -1.1504e+01, 2.8011e-15, 6.4466e-14, 5.0231e-15, -2.0131e+00, 9.3207e-01, 4.4106e-01, -2.2191e-15, -1.2753e-14, 1.0191e-14, -1.3222e+00, 2.8099e-01, 1.6825e-01, 3.7671e-15, 1.0357e-15, 4.5474e-15, -8.2707e-01, 6.8024e-01, 5.6956e-01, -1.6294e-15, 5.1669e-19, -5.8900e-16, -2.3302e+00, 9.9980e-01, 3.4673e-01, -7.7749e-16, -1.5017e-16, 2.8362e-15, 1.1337e+00, 1.1848e+00, -4.8717e-01, -3.2093e-01, -2.3499e+00, 2.8599e-01, 8.4511e-02, -9.7362e-01, -1.5483e-01, -1.8622e-01, -1.8743e-01, -2.9795e-01, -1.1812e+00, -7.5666e-01, -6.8564e-01, -5.2454e-01, 1.5093e-01, 1.8261e-01, 1.8362e+00, -1.5011e+00, -3.2054e-01, -4.1772e-01, 3.5720e-01, 8.7164e-02,
1.0766e+01, -4.9331e-01, 3.0171e-01, -3.9522e+01, -3.6635e+00, 8.4495e-02, 9.1075e+01, -1.1632e+00, -3.7271e+00, -1.2256e-12, -7.9447e-13, -2.1240e-13, 1.1434e+01, -4.2259e-01, -3.6561e-01, 1.4556e-14, -2.5256e-13, -1.9632e-13, -4.6944e+00, -1.1115e+00, 4.4189e-01, -6.5341e-15, 1.1806e-13, -1.1583e-13, 3.4326e+00, -7.2934e-01, -1.1940e+00, 4.8165e-14, 2.9164e-14, -2.6858e-14, -3.4419e+00, 7.4746e-01, -4.9956e-02, 7.4571e-15, -5.8908e-15, 1.4221e-14, -9.7539e+00, 2.0385e+00, -8.4579e-01, -3.6729e+00, 7.0578e-01, 1.0496e+00, -5.7299e+00, 2.7298e+00, -5.2497e-01, 8.7259e+00, -6.1692e+00, -1.2268e-01, 2.0605e+00, 3.1209e+00, 6.9899e-01, -5.5968e+00, -1.2753e+00, 5.9580e-01, 2.2216e+00, -1.9076e+00, -9.8541e-01, 1.2451e+01, -1.0354e+00, 6.9329e-01,
5.5505e-02, 7.2677e+00, -3.0530e+00, 5.7599e+00, -1.7297e+01, 2.9697e+00, -1.1632e+00, 4.4765e+01, -1.6073e+01, 7.7141e-14, 3.1924e-13, 8.1147e-14, -6.1954e+00, 8.2214e-02, -4.3877e-02, 2.0319e-14, -5.1162e-15, 4.7656e-14, 1.1015e+00, 1.0366e+00, -3.0504e-01, 3.7372e-14, -1.0730e-14, 2.1834e-14, -3.1743e+00, 2.5185e-02, 2.4136e-01, -3.3308e-15, -6.5453e-16, 1.1720e-15, -1.0419e-01, 1.3284e+00, 4.3120e-01, -2.8623e-15, -2.7995e-15, 1.1112e-14, 3.4235e+00, -5.4449e-01, 6.1669e-02, 1.1150e+00, -2.2421e+00, -7.3158e-01, 7.5021e-01, 8.3708e-01, 5.5411e-01, 6.0055e-01, -1.4925e-02, -1.9615e-01, 8.8463e-01, -6.7895e-01, 3.6717e-01, 1.2777e+00, -1.1159e+00, -1.3411e+00, -1.5711e+00, -2.0659e+00, -3.1149e-01, -2.4656e+00, 1.7461e+00, -4.3360e-01,
-2.7288e+00, -4.3116e+00, 6.4475e+00, 9.3143e-01, 5.5958e+00, -1.1504e+01, -3.7271e+00, -1.6073e+01, 2.5689e+01, 4.2585e-14, -1.1892e-13, -2.0994e-14, 2.5988e+00, 4.2835e-01, 1.4520e-01, -3.0702e-15, 2.1405e-14, -7.2623e-15, 5.0429e-02, -6.4965e-01, 1.1525e-01, -1.9099e-14, -5.1529e-15, -1.8027e-16, 1.8209e+00, -3.5965e-01, -5.1805e-02, -2.8364e-15, -1.2221e-15, 9.3728e-16, 2.0933e+00, -7.5095e-01, -1.7966e-01, 6.4998e-16, 2.2571e-15, -6.5502e-15, -3.3740e-01, -5.5752e-01, 7.0085e-01, -1.5258e+00, 6.6294e-01, -1.1888e+00, -5.2438e-01, 9.8718e-02, -5.2957e-02, -1.1561e+00, -1.3952e-01, -2.4214e-01, -1.5795e-01, 8.2894e-01, 2.7602e-01, 1.9619e-01, 2.9737e-02, -1.0788e-01, -1.1967e+00, 1.4648e+00, 1.5769e-01, 8.1418e-01, -4.7892e-01, -6.4110e-01,
1.0001e-13, 3.2556e-14, -1.9906e-14, -2.6905e-13, -1.0839e-13, 2.5304e-14, 7.7957e-13, 1.2799e-13, -1.0050e-13, 4.4279e-27, 1.7387e-26, -4.9841e-27, 2.0583e-13, 2.0225e-14, -1.1135e-14, -1.2955e-26, 3.8603e-27, -9.3656e-27, -4.1798e-13, 2.9316e-14, 3.6144e-14, -9.5938e-27, 2.9800e-27, -1.4155e-27, -7.9104e-14, -9.0261e-15, -5.9986e-14, 7.1374e-28, -1.5202e-27, 2.7583e-27, 3.9181e-13, 1.3297e-14, -3.2218e-15, -1.0983e-27, -5.9184e-28, 3.1641e-28, -2.1942e-13, -1.0870e-13, 1.0594e-14, 1.3749e-13, 1.8495e-13, -1.0137e-14, 1.1398e-12, -1.8134e-13, -5.6719e-15, -1.3426e-12, 5.7298e-14, 1.3905e-14, 7.7431e-14, 1.2898e-13, 3.9362e-14, 4.7604e-14, -1.9795e-13, -1.6279e-14, -9.5079e-13, 3.1937e-14, -3.2572e-14, 1.1502e-12, -2.3170e-13, 2.1262e-14,
-1.3309e-13, -5.6118e-15, 6.4340e-15, 4.0887e-13, 6.7005e-14, -2.3155e-14, -6.1329e-13, -4.4830e-14, 4.4591e-14, -8.8974e-27, -2.7683e-27, 1.2637e-26, -1.3191e-13, 3.3279e-14, -2.2444e-14, 1.8131e-26, 1.2285e-26, 3.6130e-27, 5.7229e-13, -1.9093e-14, -3.3327e-14, 1.7188e-26, -1.7233e-27, -3.6668e-27, -2.4794e-13, -5.7018e-15, 6.6516e-14, 4.2394e-27, 1.9809e-27, -1.3057e-27, 5.0322e-14, -2.4248e-14, -5.7623e-15, 2.5312e-27, -1.4119e-27, 5.6391e-28, -1.6278e-13, -1.9001e-13, 1.3303e-13, 1.5412e-13, 2.6520e-13, -1.5367e-13, -1.1393e-12, 1.7138e-13, -5.9210e-14, 1.2186e-12, 4.5456e-14, 8.7919e-14, 1.4256e-12, -2.2278e-13, -7.0294e-15, -1.6453e-12, 2.7105e-13, -8.2784e-15, -3.4125e-13, 1.5790e-13, 1.4341e-15, 4.0149e-13, -2.8005e-13, -6.7847e-15,
6.4129e-14, 8.1119e-15, 3.1000e-14, -1.1063e-13, 1.1212e-14, -2.2297e-14, 9.9180e-14, -5.0593e-14, 3.1155e-14, -2.1709e-26, -5.3246e-26, -1.5247e-26, -9.1722e-14, 2.8884e-14, -8.7180e-15, 1.1480e-26, -2.8931e-26, 1.8146e-26, 4.9204e-13, -6.1830e-14, -2.6079e-14, -5.9283e-27, -1.3436e-27, 6.7446e-27, 6.8183e-13, -1.0454e-13, 4.6132e-14, -4.8633e-27, -3.0161e-28, -5.4405e-27, -3.2373e-13, 1.7692e-14, -3.3355e-15, -1.2766e-27, 3.1630e-27, 3.9033e-28, 3.4170e-13, -1.4836e-13, 1.3935e-13, -4.2897e-13, 1.4709e-13, -1.2969e-13, -1.4351e-12, 2.4394e-13, 1.2850e-14, 1.4872e-12, -1.3990e-13, -2.7046e-14, -3.1742e-12, 5.7747e-13, -1.3679e-14, 3.7719e-12, -8.7745e-13, -1.0463e-13, 3.7166e-13, -1.9750e-14, 1.1188e-14, -9.1183e-14, 2.6169e-14, -2.6061e-15,
2.6564e-02, 3.7156e-02, 2.1025e+00, -1.1486e+01, 1.9885e+00, -2.0131e+00, 1.1434e+01, -6.1954e+00, 2.5988e+00, -1.4183e-13, -7.3124e-15, -1.1421e-13, 3.4200e+01, -9.6030e-01, -9.6765e-01, -1.9221e-13, 3.0047e-14, -1.9548e-13, -4.3096e+00, -4.2131e-01, 2.8602e+00, -7.9445e-14, 5.8709e-14, -7.0650e-14, 2.0359e+00, 4.9303e-01, -5.9343e-01, 2.4504e-14, -9.7976e-15, 2.8891e-14, 2.8231e+00, 6.8661e-01, -9.4893e-01, -1.0962e-14, -1.2531e-14, -8.9283e-15, -2.5837e+01, 6.2117e-01, 1.2311e+00, 1.0626e+01, 3.2027e+00, -2.1374e-02, 1.0511e+01, 2.0938e+00, -2.2437e-01, -7.4336e+00, 2.1282e+00, 3.7235e-01, 2.5019e+00, 3.6193e+00, 3.2124e-01, -3.6592e+00, 8.6413e-01, 9.7200e-01, -1.3656e+00, -1.5217e+00, -1.0113e-01, 1.6020e+00, -3.3364e-01, 4.8095e-01,
1.4212e-01, 8.4919e-02, -1.6259e+00, 8.6966e-01, -1.1598e+00, 9.3207e-01, -4.2259e-01, 8.2214e-02, 4.2835e-01, -1.5154e-14, 2.5447e-15, 1.3420e-14, -9.6030e-01, 1.2115e+01, -1.0244e+00, 1.1387e-14, -1.8840e-14, 9.8666e-15, 1.0447e+00, -2.7144e+00, 3.3127e-01, 3.2369e-15, -1.8507e-15, 5.1340e-15, -3.1893e-01, 1.3867e+00, 1.6629e-01, -3.5900e-15, 2.0645e-15, -2.7090e-15, -5.1090e-01, 2.1513e+00, 3.2334e-01, 9.1010e-16, 5.2524e-16, -1.3290e-16, 1.8012e-03, -6.3060e+00, 2.4799e+00, -1.6293e+00, 5.7455e+00, -1.3014e+00, -7.1687e-01, 8.3700e-02, -2.6661e-03, -1.3464e-01, -1.5028e+00, -6.8984e-01, -2.2828e-01, -2.0020e+00, -2.5533e-01, 8.7430e-01, 6.7946e-01, 1.7679e-02, 4.7862e-01, -2.5079e+00, -7.3305e-01, 3.0654e-01, 8.3636e-02, -4.1551e-02,
-1.4377e+00, 4.8427e-01, 4.5602e-01, 4.3537e-01, -1.3751e+00, 4.4106e-01, -3.6561e-01, -4.3877e-02, 1.4520e-01, 1.2418e-14, 1.5735e-14, -2.7646e-15, -9.6765e-01, -1.0244e+00, 5.9243e+00, 1.4552e-15, 7.0842e-15, 3.5021e-15, -2.3903e+00, 4.4792e-01, -2.0665e+00, 6.9072e-17, -1.5746e-15, 3.4869e-16, 9.3299e-01, -7.5156e-01, 2.6395e-02, 3.9959e-16, -8.8523e-16, -2.5079e-18, -1.0222e-01, -3.2450e-01, 2.2077e-01, -8.9370e-16, 1.9038e-16, 2.9566e-16, -3.4161e-01, -4.9296e-01, -4.2620e+00, 1.0847e+00, -2.4879e+00, 1.7653e+00, -6.7261e-01, -8.2961e-01, 9.0961e-01, 6.2730e-01, 2.9141e-01, -5.8005e-01, 2.9776e-02, 1.0046e-01, 7.3544e-01, 6.9806e-01, 7.3704e-01, -7.1339e-01, -1.7053e-01, 3.7727e-01, 2.3064e-02, 4.2270e-02, 1.5973e-01, 4.2190e-01,
1.5394e-14, -1.6842e-14, 1.4780e-14, -4.7585e-14, 3.1822e-14, -1.9409e-14, 4.0190e-14, -5.0834e-14, 2.9003e-14, 9.8373e-28, 4.8626e-27, 1.4736e-27, 6.3024e-14, -1.2502e-14, 3.4787e-15, -2.0598e-28, 4.9380e-27, -2.4365e-27, -6.4512e-14, 2.6984e-15, 2.1878e-15, 1.4159e-27, 5.1093e-28, -1.6609e-27, -6.4350e-14, 2.0722e-14, -7.6913e-15, 1.4037e-27, -4.0823e-29, 5.4513e-28, 1.0245e-13, -1.8079e-14, -3.7549e-15, 2.4614e-28, -5.3353e-28, 9.5939e-29, -2.4511e-13, 7.9755e-14, -2.8826e-14, 2.5320e-13, -6.0900e-14, 2.1974e-14, 1.1511e-13, -5.6880e-14, 9.1204e-15, -1.8200e-14, 6.9808e-14, -5.0333e-15, 3.5029e-13, -1.7561e-13, -1.4436e-14, -3.9641e-13, 2.5307e-13, 4.7457e-14, -2.8356e-13, 1.0437e-13, 5.1518e-15, 3.2595e-13, -1.7894e-13, -1.9456e-14,
4.1720e-15, -5.3786e-15, 3.9295e-16, -1.0865e-14, 1.0809e-15, -4.2621e-15, 5.3606e-14, -1.3583e-14, 1.0638e-14, 9.8853e-27, 1.3188e-26, -2.1906e-27, 6.3867e-14, 3.5412e-15, -2.4590e-15, -8.8344e-27, 2.1113e-27, -4.6054e-27, -2.7767e-13, -3.8264e-15, 1.8999e-14, -6.3355e-27, 1.0915e-27, 1.6557e-28, -2.3928e-14, 1.3494e-14, -2.5473e-14, -3.2676e-28, -9.8435e-28, 1.6683e-27, 1.2030e-13, -5.5158e-15, -1.9599e-15, -7.8201e-28, -1.4314e-28, -7.5304e-29, -3.8374e-14, -8.3043e-15, -6.9097e-15, -2.2607e-14, 2.6409e-14, 6.4689e-15, 8.0641e-13, -6.0538e-14, 9.0883e-15, -8.1451e-13, -3.6914e-14, -2.7518e-15, -1.2063e-14, -2.6221e-14, 7.2038e-15, 9.3480e-14, 3.1077e-14, 1.1744e-14, -3.1459e-13, 2.0413e-14, -5.5725e-15, 4.3497e-13, -7.7694e-14, 1.7105e-15,
-6.4206e-16, -6.2584e-15, 5.7898e-15, -1.6898e-15, 1.6893e-14, -8.9904e-15, -2.1561e-14, -3.6740e-14, 2.2992e-14, -2.5912e-27, -5.1626e-27, 3.8199e-28, -4.3255e-14, 1.9570e-15, 8.1079e-16, 3.2987e-27, -1.2277e-27, 2.2034e-27, 4.4754e-14, 1.9385e-16, -3.2777e-15, 1.4022e-27, -3.9581e-28, 3.6367e-28, 4.0202e-14, -8.8999e-16, 6.6880e-16, -1.9751e-29, 2.3649e-28, -6.5598e-28, -3.1852e-15, -6.4370e-15, 6.1966e-16, 2.1664e-28, 1.6017e-28, 9.3464e-29, 1.4856e-13, -6.7672e-15, 3.9146e-15, -1.3950e-13, -4.6145e-15, -1.4247e-15, -2.2894e-13, -1.3738e-14, -5.0728e-15, 2.9344e-13, 2.6143e-14, 4.2693e-15, -1.1322e-13, -1.5851e-14, -3.1489e-15, 9.5637e-14, 4.0675e-14, 5.6219e-15, -1.0611e-14, 4.7741e-14, 5.3541e-15, -1.3763e-14, -5.9026e-14, -1.0961e-14,
1.1009e+00, 7.4729e-01, 1.4610e+00, 6.0401e+00, 1.4583e+00, -1.3222e+00, -4.6944e+00, 1.1015e+00, 5.0429e-02, -5.1210e-13, -6.5800e-13, 1.5750e-13, -4.3096e+00, 1.0447e+00, -2.3903e+00, 5.5368e-13, -2.8341e-14, 2.7172e-13, 5.4597e+01, -2.7116e+00, -8.9915e-01, 3.7554e-13, -5.5512e-14, -2.3738e-14, -7.2194e+00, 9.6463e-01, 5.5039e+00, 3.7975e-14, 4.6373e-14, -8.4108e-14, 2.1158e+00, 2.3449e-01, -9.7647e-01, 5.0534e-14, 4.0431e-16, 1.8995e-14, -4.4179e-01, -7.6489e-01, 2.5595e+00, -4.0195e+00, 4.8678e+00, -1.5650e+00, -5.1432e+01, 8.8625e+00, -4.0608e-01, 2.3724e+01, 3.4355e-01, -4.3109e-02, 1.0009e+00, 1.7964e+00, -2.7085e+00, -5.1666e+00, -4.2589e+00, 1.3452e-01, 2.4051e+00, -7.9083e-02, 3.1056e-02, -1.4037e+00, 2.0486e+00, 8.2318e-01,
1.2368e+00, 5.8689e-01, -1.5596e+00, -7.5754e-01, -6.9527e-01, 2.8099e-01, -1.1115e+00, 1.0366e+00, -6.4965e-01, -2.4141e-14, 5.7985e-14, -6.9354e-15, -4.2131e-01, -2.7144e+00, 4.4792e-01, -5.0889e-15, 2.7323e-14, -1.4466e-14, -2.7116e+00, 2.0076e+01, -8.7943e-01, -9.8808e-15, 2.3527e-15, -8.7659e-15, 7.6104e-01, -4.9807e+00, 4.5477e-01, 6.2178e-15, -5.2631e-15, 9.4305e-15, -4.4203e-02, 1.0029e+00, 1.8972e-01, -1.8668e-15, -2.8485e-15, 2.5794e-15, -7.9837e-02, -1.9583e+00, -9.3863e-01, 3.3733e+00, -1.8606e+00, 9.8517e-01, -1.0580e+00, -8.9302e+00, -1.2619e-01, -2.4261e+00, 7.7712e+00, 2.0904e+00, 1.5536e+00, 1.2621e+00, -4.0871e-01, -6.2194e-01, -1.1391e+00, -2.6073e-01, 3.9802e-01, -2.2132e+00, -4.8114e-01, 1.4640e+00, -4.0136e-01, 7.2812e-01,
-1.6304e+00, 1.1890e+00, 2.6867e-01, -6.3324e-01, -5.8145e-01, 1.6825e-01, 4.4189e-01, -3.0504e-01, 1.1525e-01, 4.0456e-14, 3.4395e-14, -1.2086e-15, 2.8602e+00, 3.3127e-01, -2.0665e+00, -2.7085e-14, -6.3421e-17, -1.1371e-14, -8.9915e-01, -8.7943e-01, 8.2129e+00, -1.9013e-14, 2.7661e-15, 2.2806e-15, -2.9441e+00, -1.2646e-01, -3.5354e+00, -2.6787e-15, -2.6237e-15, 3.6561e-15, 7.7582e-01, -2.4361e-01, 1.8002e-01, -2.1820e-15, 7.6509e-16, -7.3188e-16, 1.2419e+00, 1.8533e+00, 3.9131e-01, -6.8263e-01, 3.6081e-01, 2.3117e-01, 2.7095e+00, 1.1406e-01, -4.4880e+00, -1.5619e+00, -1.2949e+00, 1.8077e+00, -2.0597e-01, -8.7189e-01, 1.5460e+00, 1.0490e+00, 6.5491e-01, -3.9369e-01, -1.4710e-01, 4.1643e-01, 1.5851e-01, 1.6570e-01, 1.2797e-01, -3.5199e-01,
1.9682e-14, 2.8876e-15, 1.8359e-14, -7.5921e-14, 7.7730e-15, -1.3967e-14, 1.1334e-13, -2.8593e-14, 1.4635e-14, -1.4781e-26, -1.4090e-26, 4.2753e-27, -6.7661e-14, -8.8833e-17, -6.2689e-16, 1.3324e-26, 1.6834e-27, 4.5468e-27, 3.1518e-13, -1.2525e-14, -1.4005e-14, 9.3415e-27, -7.7231e-28, -1.3997e-27, -5.9644e-14, -1.0884e-14, 1.5700e-14, 1.9666e-27, 1.3251e-27, -1.7805e-27, 8.3851e-14, -4.9091e-15, -1.7048e-15, 1.4304e-27, -3.3518e-28, 5.5901e-28, 1.5406e-13, 2.1348e-15, 3.9539e-15, -1.8521e-13, -1.5990e-14, 2.6569e-15, -9.4026e-13, 9.5895e-14, -1.7854e-14, 1.0018e-12, 4.3898e-16, 1.2972e-14, 3.6886e-13, -1.1305e-14, 1.1598e-14, -4.8090e-13, 3.8448e-14, -1.7543e-14, -2.6330e-13, 4.3815e-14, -1.1185e-14, 2.9355e-13, -1.1346e-13, 1.1988e-14,
1.1215e-15, 5.3095e-15, 4.9064e-15, -1.7144e-14, -7.1001e-15, -2.7215e-15, 3.5423e-14, 5.8330e-15, -1.1358e-15, -2.4278e-27, 1.5802e-27, 2.7305e-27, -1.1875e-14, -3.1023e-15, -8.2379e-16, 3.0779e-27, 3.9237e-27, -5.2620e-28, 3.4616e-14, 1.8315e-15, -7.8942e-16, 3.1933e-27, 1.4090e-29, -1.1376e-27, -8.6576e-14, -1.6615e-15, -1.3442e-15, 1.2647e-27, 3.7965e-28, 7.8338e-29, 1.0142e-13, -5.4254e-15, -9.0990e-16, 5.8047e-28, -4.7033e-28, 2.3775e-28, 3.6825e-14, 2.0095e-14, -8.7575e-15, -9.8670e-14, -2.2315e-14, 9.5265e-15, -9.4887e-14, -5.9440e-15, -6.2843e-15, 1.3624e-13, 2.4954e-14, 9.8415e-15, 4.4419e-13, -3.7299e-14, 9.8067e-15, -5.2340e-13, 5.5229e-14, -1.5345e-15, -2.6280e-13, 3.6695e-14, -7.4662e-15, 2.9033e-13, -9.1441e-14, 4.6402e-15,
-8.0296e-15, -2.6499e-15, -2.4402e-15, 3.1036e-14, 1.8319e-16, -4.0195e-16, -2.9501e-14, 1.6689e-15, 4.3109e-15, 5.4830e-27, 6.3668e-27, 1.3104e-28, -5.3813e-15, 3.2912e-15, -2.6599e-15, -3.2331e-27, 1.0840e-27, -1.5209e-27, -9.4344e-14, -7.1888e-15, 9.8649e-15, -2.1276e-27, 1.9019e-28, 3.3129e-28, -4.7186e-14, 1.4507e-14, -1.0847e-14, -2.8093e-28, -2.9939e-28, 6.7207e-28, 6.5813e-14, -3.9310e-15, 5.9204e-16, -2.2509e-28, -3.9173e-29, -5.8999e-29, 1.0167e-13, -2.8958e-15, -9.4965e-15, -1.5383e-13, -1.0154e-15, 1.4844e-14, 3.1374e-13, 3.0809e-15, 3.7118e-15, -3.6597e-13, -4.2816e-14, -5.6185e-15, 8.8562e-14, -5.3380e-14, 1.8838e-15, -5.1496e-14, 6.1951e-14, 8.0930e-15, -9.9329e-14, 1.0864e-14, -1.2575e-15, 6.0401e-14, -1.2361e-14, -5.4433e-16,
2.8511e+00, 8.1236e-01, 1.6838e+00, -2.3640e+00, 3.4383e-01, -8.2707e-01, 3.4326e+00, -3.1743e+00, 1.8209e+00, -9.1466e-14, -3.2496e-13, -1.8989e-13, 2.0359e+00, -3.1893e-01, 9.3299e-01, -6.1022e-14, -2.2534e-13, 6.2638e-14, -7.2194e+00, 7.6104e-01, -2.9441e+00, -1.4521e-13, 3.8405e-15, 5.2242e-14, 4.0045e+01, -4.7764e+00, 2.7821e-01, -4.9891e-14, -1.4385e-14, -2.0337e-14, -8.6755e+00, 1.2935e+00, 1.9433e+00, -2.4009e-14, 2.2371e-14, -6.8995e-15, 1.9147e+00, 1.1451e+00, 7.1606e-01, -1.1430e+00, -1.6972e+00, -1.3954e+00, 2.8010e-01, 1.0651e+00, 1.5521e+00, 2.6362e+00, 1.9847e+00, -5.6087e-01, -3.0909e+01, 6.5932e+00, 2.7714e-01, 1.8636e+01, -2.7831e+00, 8.6143e-01, 4.3686e+00, 2.4259e+00, -1.6274e+00, -3.9141e+00, 2.1045e-01, 9.1505e-01,
6.1671e-01, 5.3561e-01, -1.8416e+00, -7.3847e-01, -1.5925e-01, 6.8024e-01, -7.2934e-01, 2.5185e-02, -3.5965e-01, 7.1298e-14, 5.6882e-14, 2.8923e-14, 4.9303e-01, 1.3867e+00, -7.5156e-01, -8.2207e-15, 1.1833e-14, -3.3343e-15, 9.6463e-01, -4.9807e+00, -1.2646e-01, 1.2486e-14, -2.3642e-15, -9.2230e-16, -4.7764e+00, 1.7651e+01, 1.1810e+00, 1.0816e-15, 9.6771e-16, 2.2223e-16, 7.2054e-01, -2.8064e+00, -3.5323e-02, 1.8339e-15, -7.3720e-16, -1.9839e-15, 4.6437e-01, -6.8951e-01, 2.4891e-01, 4.4414e-01, -7.9509e-01, 9.0486e-02, 1.4092e+00, 3.3390e-02, -1.8133e-01, -1.8721e-01, -1.9508e+00, 4.9280e-03, -4.1229e-01, -7.2927e+00, -1.0438e+00, -2.5059e+00, 5.2589e+00, 5.8198e-01, 8.4888e-01, -1.2843e+00, 5.1001e-02, -2.0468e+00, -2.8676e-01, -3.9556e-01,
-1.0517e+00, 3.0761e-01, -7.0508e-01, 9.0211e-01, 2.0414e-01, 5.6956e-01, -1.1940e+00, 2.4136e-01, -5.1805e-02, -2.8017e-14, -3.5933e-14, 1.0632e-14, -5.9343e-01, 1.6629e-01, 2.6395e-02, 3.2427e-14, -3.5847e-15, 1.6248e-14, 5.5039e+00, 4.5477e-01, -3.5354e+00, 2.6400e-14, -4.1079e-15, -1.3279e-15, 2.7821e-01, 1.1810e+00, 7.5201e+00, 1.4555e-15, 3.4708e-15, -5.1782e-15, -3.4764e+00, -9.3855e-02, -1.8723e+00, 2.7799e-15, -4.3837e-16, 6.0680e-16, -1.4129e+00, -8.0034e-01, 9.6112e-01, -3.3056e-02, 1.6533e-01, -8.1498e-01, -2.3672e+00, 1.5265e+00, 1.2133e+00, 1.4732e+00, 5.5664e-01, 1.2927e-01, 2.1472e-01, 2.3321e-01, -3.7675e+00, -8.4812e-01, -1.4985e+00, 1.3109e+00, 1.0930e+00, -5.3005e-01, 4.2967e-01, -3.3928e-01, -8.3606e-04, 2.0539e-01,
-1.0532e-15, -7.1112e-15, -3.9821e-15, 1.4228e-14, 8.1127e-15, 2.3869e-15, -3.6254e-14, -8.2954e-15, 3.6245e-15, 4.4434e-27, 3.3512e-27, -1.7114e-27, 1.3971e-14, -4.9865e-15, 1.3228e-15, -4.2504e-27, -1.2390e-27, -1.1377e-27, -1.0700e-13, 7.9305e-15, 4.1566e-15, -3.1832e-27, 1.7361e-28, 6.4431e-28, 4.1608e-14, -1.5876e-15, -6.1872e-15, -8.2113e-28, -4.1944e-28, 4.7823e-28, -4.9143e-14, 1.0303e-15, 8.6878e-16, -4.9369e-28, 1.9116e-28, -2.1101e-28, -1.2453e-14, 1.6352e-14, -6.3282e-15, 5.0260e-14, -2.0303e-14, 5.2469e-15, 2.8060e-13, -4.5160e-14, 2.9569e-15, -2.9741e-13, 8.1222e-15, -1.5758e-15, -1.8147e-13, 3.4877e-14, -1.6542e-15, 1.9997e-13, -4.3718e-14, 2.0145e-15, 1.4618e-13, -1.2953e-14, 7.7088e-15, -1.7147e-13, 4.3256e-14, -1.0437e-14,
-1.7029e-15, -2.7121e-15, -7.3274e-16, 1.8157e-15, 5.1694e-15, 4.0574e-16, -1.2587e-14, -4.1365e-15, 2.4409e-16, 9.5389e-28, 2.2356e-27, 5.8186e-28, 1.3532e-14, -2.8870e-15, 1.1302e-15, -6.8412e-28, 1.2814e-27, -9.2981e-28, -2.3474e-14, 4.7361e-15, 2.0439e-17, 2.9514e-28, 6.8403e-29, -3.8095e-28, -2.1715e-14, 5.0356e-15, -1.4004e-15, 2.1997e-28, 5.9146e-30, 2.4467e-28, 6.3765e-16, -2.5321e-15, -5.6840e-17, 4.0611e-29, -1.4498e-28, -5.2940e-29, -5.5951e-14, 6.9592e-15, -6.8386e-15, 8.3588e-14, -4.1994e-15, 5.1501e-15, 5.8817e-14, -1.6262e-14, 1.4038e-15, -5.4556e-14, 1.6481e-14, -3.8202e-16, 1.2583e-13, -2.5133e-14, -1.0777e-15, -1.7444e-13, 4.3409e-14, 6.5588e-15, 2.2834e-14, 9.1432e-15, 2.6443e-15, -4.2312e-14, -9.0385e-15, -5.3591e-15,
-2.8311e-15, -3.0421e-16, 9.1358e-16, -1.1962e-14, 3.6522e-16, -8.8535e-16, 2.2921e-14, -3.9012e-15, 9.3591e-16, -7.8635e-28, 2.8195e-28, 1.2388e-27, -5.3998e-15, 2.6300e-15, -1.7958e-15, 9.9723e-28, 9.6098e-28, -1.5744e-28, 1.8385e-14, -5.6451e-15, 4.5434e-16, 1.2981e-27, -7.8939e-29, -3.1105e-28, -3.4249e-14, 5.9247e-15, 1.0147e-15, 2.9141e-28, 2.1109e-28, -2.0942e-29, 3.4380e-15, -1.4121e-15, -3.4995e-16, 2.2183e-28, -1.3140e-28, 1.2653e-29, 3.0403e-14, -1.1582e-14, 2.3737e-15, -5.7222e-14, 1.6213e-14, -1.2870e-15, -4.5138e-14, 2.4835e-14, -4.5613e-15, 5.1001e-14, -2.5285e-14, 3.9613e-15, 1.7499e-13, -3.4073e-14, 5.3880e-16, -2.2045e-13, 5.3833e-14, 4.0922e-15, 6.9445e-15, 3.1170e-15, 1.3730e-15, -2.4414e-14, -1.7755e-15, -2.5866e-15,
7.5163e-01, 8.1164e-01, 3.1642e+00, 5.3366e+00, 1.4458e+00, -2.3302e+00, -3.4419e+00, -1.0419e-01, 2.0933e+00, 1.4695e-13, 1.7263e-13, 8.3184e-14, 2.8231e+00, -5.1090e-01, -1.0222e-01, 6.4513e-14, 2.2317e-13, -2.1571e-14, 2.1158e+00, -4.4203e-02, 7.7582e-01, 5.8906e-14, 2.5639e-15, -3.2333e-14, -8.6755e+00, 7.2054e-01, -3.4764e+00, 5.3135e-14, -6.4204e-15, 1.6852e-14, 4.8117e+01, -2.1866e+00, 9.0922e-01, 1.3870e-14, -1.7750e-14, 1.2519e-14, 5.5112e-01, 2.7416e+00, -8.4853e-01, -9.6580e-01, -1.0009e+00, 1.2018e+00, 8.1789e-01, 5.6101e-01, 9.1642e-01, -2.3566e+00, 5.2337e-01, -4.4121e-01, 6.3617e+00, -1.4150e+00, 1.6644e+00, -1.0106e+01, 2.6640e+00, 2.6652e-02, -3.5122e+01, 7.0089e+00, -2.1737e+00, 1.2289e+01, -3.2326e+00, 1.7004e+00,
2.1607e+00, 6.4821e-01, -1.7176e+00, -1.3070e+00, -4.7239e-01, 9.9980e-01, 7.4746e-01, 1.3284e+00, -7.5095e-01, -6.4781e-14, -1.3042e-14, -1.0310e-14, 6.8661e-01, 2.1513e+00, -3.2450e-01, 5.2924e-16, -1.6828e-14, -1.0052e-15, 2.3449e-01, 1.0029e+00, -2.4361e-01, -2.0061e-15, 3.7961e-15, -1.9580e-15, 1.2935e+00, -2.8064e+00, -9.3855e-02, -2.8490e-16, 6.1915e-16, 1.7712e-16, -2.1866e+00, 1.0248e+01, 1.1026e+00, -5.5931e-16, -5.5384e-16, 1.0095e-15, -1.0731e+00, -1.7706e+00, 1.0857e-01, 2.6297e-01, 5.2349e-01, 4.1699e-01, -7.6005e-01, -1.5378e+00, -4.5830e-01, -1.6023e-01, 1.4660e-01, 1.3043e+00, -1.9317e-01, 7.2871e-01, -1.4464e-01, 8.7921e-01, -6.1159e-01, 5.0658e-01, -7.7447e-01, -5.8880e+00, -1.3848e+00, 8.0654e-01, 3.7569e+00, 7.0988e-01,
-7.7284e-01, -2.2419e-01, -1.2537e+00, 4.3130e-01, 1.0456e-01, 3.4673e-01, -4.9956e-02, 4.3120e-01, -1.7966e-01, 1.3033e-14, 8.6881e-15, 1.1031e-15, -9.4893e-01, 3.2334e-01, 2.2077e-01, -1.0637e-15, -1.3778e-15, 4.2721e-15, -9.7647e-01, 1.8972e-01, 1.8002e-01, -2.2485e-15, -1.8762e-15, 2.5324e-15, 1.9433e+00, -3.5323e-02, -1.8723e+00, -1.7780e-15, 4.2628e-18, -7.7654e-17, 9.0922e-01, 1.1026e+00, 5.0050e+00, -3.9523e-16, 5.6615e-16, -2.5334e-16, 4.6975e-01, 5.3933e-01, -1.2358e-01, -3.2182e-01, -3.7425e-01, -1.9522e-01, -3.7525e-01, 1.0122e-01, 1.0426e-01, -3.7385e-01, -4.7073e-01, -4.3244e-01, 1.0496e-01, -1.3650e-01, 9.5866e-01, 2.9730e-01, 7.6466e-01, -9.4128e-01, 2.9743e-01, 2.0834e-01, -4.2563e+00, -8.9671e-01, -3.5780e-01, 1.8041e+00,
-1.2726e-14, -5.9035e-16, -1.1904e-16, 1.8896e-14, -3.0583e-16, -1.3907e-15, -6.7685e-15, 6.3866e-15, -2.7559e-15, 5.2328e-28, 4.5155e-27, 2.3717e-27, 1.8192e-14, -5.0862e-16, -3.7222e-17, 2.5891e-28, 3.7633e-27, -1.7430e-27, 1.8726e-15, 4.2200e-15, -2.0602e-15, 2.0761e-27, 8.0634e-29, -1.1267e-27, -9.0156e-14, 1.0339e-14, 1.3290e-15, 8.7952e-28, 2.0974e-28, 4.2599e-28, 4.3721e-14, -3.8663e-15, -1.3310e-15, 3.3159e-28, -4.4618e-28, -3.4352e-30, -9.4886e-14, -5.8255e-15, -6.9749e-15, 1.0391e-13, 1.8455e-14, 4.3780e-15, 3.1956e-14, -9.9422e-15, 3.6831e-15, -3.9622e-14, 2.3307e-14, -3.1911e-15, 4.3128e-13, -6.6071e-14, -4.7362e-15, -5.1773e-13, 9.6273e-14, 1.9385e-14, -5.5118e-14, 1.4296e-14, 1.6442e-15, 5.8454e-15, -1.9886e-14, -4.0701e-15,
-4.0988e-16, 1.1790e-15, -2.4441e-15, 1.8331e-14, -3.5361e-15, 2.3554e-15, -2.9856e-14, 4.4973e-15, 6.6429e-17, 1.6580e-27, -2.1233e-27, -2.4498e-27, -1.6957e-14, 1.3718e-15, 9.9763e-16, -1.6231e-27, -3.4643e-27, 1.2001e-27, -2.7455e-14, -1.0227e-15, 2.1503e-15, -2.8641e-27, -4.7221e-29, 1.2352e-27, 7.7063e-14, -7.0799e-15, -2.1431e-15, -1.0361e-27, -3.4521e-28, -1.7952e-28, -3.4466e-14, 2.8062e-15, 9.8513e-16, -4.5574e-28, 4.4575e-28, -5.5080e-29, 8.2730e-14, -3.1227e-16, 8.2647e-16, -8.3793e-14, -9.9023e-15, 1.6988e-15, 6.5903e-14, -8.7082e-15, 4.7477e-15, -8.7184e-14, -7.4570e-15, -6.9953e-15, -4.2173e-13, 5.4535e-14, -1.0025e-15, 5.2766e-13, -8.9844e-14, -9.5232e-15, 6.7279e-14, -1.2495e-14, 1.8670e-15, -5.3408e-14, 2.9719e-14, -4.1504e-16,
3.4091e-15, -8.6944e-17, 7.6334e-16, -5.9482e-15, 9.9576e-16, -4.0865e-16, 4.8089e-15, -1.0597e-15, -4.1891e-16, -1.0947e-27, -1.6915e-27, -1.2646e-28, 3.6002e-16, -1.5260e-15, 1.1932e-15, 7.8100e-28, -3.6590e-28, 4.7339e-28, 1.8064e-14, 3.2857e-17, -1.4767e-15, 4.0043e-28, -4.4157e-29, -2.9071e-29, 1.2610e-14, -1.4267e-15, 1.0931e-15, 4.5650e-29, 4.7420e-29, -1.8780e-28, -5.4015e-15, -1.2243e-15, -1.0579e-16, 3.6203e-29, 3.2832e-29, 1.8988e-29, -2.1722e-14, 4.4595e-15, -5.9030e-17, 3.7925e-14, -5.7390e-15, -8.2013e-16, -7.4740e-14, 2.6434e-15, -3.4337e-16, 9.4074e-14, 3.5888e-15, 3.7867e-16, -4.7757e-14, 2.1615e-15, -3.6695e-16, 5.0478e-14, -8.7492e-16, -1.0835e-15, 3.5577e-15, 1.0984e-14, 1.4141e-15, -8.3159e-15, -1.4590e-14, -2.6889e-15,
-2.5202e+00, 1.0047e+00, -1.4920e+00, 9.0895e+00, -2.2820e+00, 1.1337e+00, -9.7539e+00, 3.4235e+00, -3.3740e-01, 1.2865e-13, -3.5958e-13, 1.5661e-13, -2.5837e+01, 1.8012e-03, -3.4161e-01, 4.2155e-13, -3.3625e-13, 4.8046e-13, -4.4179e-01, -7.9837e-02, 1.2419e+00, 3.0623e-14, -1.2224e-13, 2.4760e-13, 1.9147e+00, 4.6437e-01, -1.4129e+00, -1.2148e-13, 3.1081e-14, -8.0302e-14, 5.5112e-01, -1.0731e+00, 4.6975e-01, 2.0645e-14, 5.4823e-14, 1.9093e-14, 1.0882e+02, -2.0433e+00, -1.6955e+00, -6.8992e+01, -5.5328e+00, 4.6773e+00, -1.8164e+01, 2.3286e-01, -1.5112e+00, 1.1386e+01, -4.4058e+00, -9.0558e-02, -1.5628e+01, 2.4398e+00, 6.5138e-01, 1.4230e+01, -5.0596e+00, -9.6806e-01, 5.6489e+00, 3.0234e+00, 6.4176e-01, -7.1797e+00, 2.7640e-01, -8.5708e-01,
1.7349e+00, -3.9160e-01, 8.9271e-01, -5.5899e+00, -6.7358e-01, 1.1848e+00, 2.0385e+00, -5.4449e-01, -5.5752e-01, 7.6890e-14, 1.8177e-14, -6.5122e-14, 6.2117e-01, -6.3060e+00, -4.9296e-01, -3.4858e-14, 9.9842e-14, -1.7143e-14, -7.6489e-01, -1.9583e+00, 1.8533e+00, -1.5006e-14, 5.7619e-15, -1.6976e-14, 1.1451e+00, -6.8951e-01, -8.0034e-01, 1.8091e-14, -9.7546e-15, 1.0121e-14, 2.7416e+00, -1.7706e+00, 5.3933e-01, -2.6098e-15, -1.2148e-15, 4.3498e-15, -2.0433e+00, 4.9051e+01, -9.0558e+00, -1.6748e+00, -3.5307e+01, 8.1472e+00, 4.7485e+00, -9.8193e+00, -5.8471e-01, 1.4397e+00, 6.5020e+00, -4.2834e-01, -1.6441e+00, 6.0288e-01, 8.9349e-01, -3.5669e+00, -1.1228e+00, -8.0871e-01, -3.2505e+00, 2.1569e+00, -9.3049e-01, 2.1508e+00, -1.4821e+00, 2.9178e-01,
7.2543e-01, 1.4094e-01, -9.4193e-01, 4.2536e-01, -1.7777e-01, -4.8717e-01, -8.4579e-01, 6.1669e-02, 7.0085e-01, -5.0790e-14, -7.3876e-14, 1.6115e-14, 1.2311e+00, 2.4799e+00, -4.2620e+00, 7.6436e-15, -5.0683e-14, 3.9813e-15, 2.5595e+00, -9.3863e-01, 3.9131e-01, 9.1834e-15, 1.7632e-15, 2.2031e-15, 7.1606e-01, 2.4891e-01, 9.6112e-01, -3.9089e-15, 5.2279e-15, -6.4861e-15, -8.4853e-01, 1.0857e-01, -1.2358e-01, 1.3564e-15, 7.0288e-17, -2.5069e-15, -1.6955e+00, -9.0558e+00, 2.0171e+01, 6.5841e-01, 1.0584e+01, -1.6646e+01, -8.8839e-01, 5.2932e+00, -4.1719e+00, 1.0230e+00, -4.7944e+00, 4.1604e+00, -8.7143e-02, 1.0153e+00, -2.2843e+00, 1.4571e+00, -1.5568e+00, 1.9892e+00, 1.5649e+00, -9.3867e-01, -1.8061e-01, -8.5795e-01, 4.9548e-01, -2.4911e-01,
2.5301e+00, -1.4642e+00, -1.7198e-01, 2.2492e+00, 3.0886e+00, -3.2093e-01, -3.6729e+00, 1.1150e+00, -1.5258e+00, 4.6255e-14, 5.5788e-13, -1.1452e-13, 1.0626e+01, -1.6293e+00, 1.0847e+00, -3.7941e-13, 4.2209e-13, -4.1283e-13, -4.0195e+00, 3.3733e+00, -6.8263e-01, 3.1587e-14, 9.1827e-14, -2.5123e-13, -1.1430e+00, 4.4414e-01, -3.3056e-02, 1.3089e-13, -4.2649e-14, 8.3716e-14, -9.6580e-01, 2.6297e-01, -3.2182e-01, -2.6668e-14, -5.8566e-14, -1.8505e-14, -6.8992e+01, -1.6748e+00, 6.5841e-01, 1.3868e+02, 5.6683e+00, -2.8944e+00, 7.4215e+00, -4.8922e+00, 6.4704e-02, -1.0235e+01, 6.7458e+00, 8.1216e-01, 1.0165e+01, -6.3372e-01, -9.2290e-01, -1.5128e+01, 1.5403e+00, 1.3831e+00, 1.8289e+00, -8.4850e-01, -3.3619e-02, 5.3660e+00, 1.1620e+00, 7.2508e-01,
-4.1914e+00, -1.4842e+00, 1.7615e+00, 1.7430e+00, 3.4050e+00, -2.3499e+00, 7.0578e-01, -2.2421e+00, 6.6294e-01, -1.2998e-13, -5.0374e-16, 5.9897e-14, 3.2027e+00, 5.7455e+00, -2.4879e+00, -1.4132e-14, -1.0483e-13, -4.8151e-14, 4.8678e+00, -1.8606e+00, 3.6081e-01, -2.8765e-15, 1.0775e-14, -7.4693e-15, -1.6972e+00, -7.9509e-01, 1.6533e-01, -1.1132e-14, 8.4168e-15, 1.3003e-15, -1.0009e+00, 5.2349e-01, -3.7425e-01, 1.8185e-15, -3.1907e-15, -9.1967e-15, -5.5328e+00, -3.5307e+01, 1.0584e+01, 5.6683e+00, 7.2115e+01, -1.2131e+01, -7.2098e-01, 5.2242e+00, -5.8822e-01, -4.2571e+00, -9.2716e+00, 1.8232e-01, 5.4994e+00, -2.0284e+00, -3.1417e-01, 3.0662e+00, 1.3070e+00, 1.0964e+00, 2.0227e+00, -3.7660e-01, 5.3030e-01, -4.4028e+00, 1.5243e+00, -2.6109e-02,
-6.2502e-03, -9.4781e-01, 8.7479e-01, -9.3428e-01, 1.1819e+00, 2.8599e-01, 1.0496e+00, -7.3158e-01, -1.1888e+00, 3.7083e-14, 4.2328e-14, -1.6883e-14, -2.1374e-02, -1.3014e+00, 1.7653e+00, 5.9390e-15, 3.9054e-14, 7.6956e-15, -1.5650e+00, 9.8517e-01, 2.3117e-01, -8.0304e-15, -3.4908e-15, 3.3733e-15, -1.3954e+00, 9.0486e-02, -8.1498e-01, 7.4162e-16, -3.9851e-15, 3.4838e-15, 1.2018e+00, 4.1699e-01, -1.9522e-01, -2.7779e-16, 1.7131e-15, 3.2817e-15, 4.6773e+00, 8.1472e+00, -1.6646e+01, -2.8944e+00, -1.2131e+01, 2.4469e+01, 1.9847e-01, -3.8402e+00, 3.3151e+00, -7.7438e-01, 5.2334e+00, -5.5185e+00, -2.0884e-01, -7.0706e-01, 1.6066e+00, -6.2119e-01, 1.2398e+00, -2.1332e+00, -1.6199e+00, 3.3499e-02, -7.9949e-02, 8.5763e-01, -6.4090e-01, -2.3809e-01,
-1.1810e+00, -1.5654e+00, -3.8160e-01, 3.0059e+00, 1.6923e+00, 8.4511e-02, -5.7299e+00, 7.5021e-01, -5.2438e-01, 1.8301e-12, 2.2203e-12, -3.4919e-13, 1.0511e+01, -7.1687e-01, -6.7261e-01, -1.6347e-12, 2.5073e-13, -7.9435e-13, -5.1432e+01, -1.0580e+00, 2.7095e+00, -1.0438e-12, 1.4187e-13, 5.9216e-14, 2.8010e-01, 1.4092e+00, -2.3672e+00, -1.1078e-13, -1.4857e-13, 2.7424e-13, 8.1789e-01, -7.6005e-01, -3.7525e-01, -1.3994e-13, -1.4137e-14, -5.1853e-14, -1.8164e+01, 4.7485e+00, -8.8839e-01, 7.4215e+00, -7.2098e-01, 1.9847e-01, 1.5817e+02, -1.5401e+01, 2.5629e+00, -1.0780e+02, -4.8375e+00, 7.0452e-01, -5.1559e+00, -6.4715e-01, 2.1012e-01, 2.8328e+00, 7.2448e-01, 1.9928e+00, -5.5683e+00, 2.1482e+00, 4.1037e-01, 1.2414e+01, -8.1959e-01, -2.2875e-01,
-3.8859e-01, 3.5418e-01, 1.6542e+00, 3.5036e-01, -1.5579e-02, -9.7362e-01, 2.7298e+00, 8.3708e-01, 9.8718e-02, -4.9572e-14, -3.3045e-13, 7.8996e-14, 2.0938e+00, 8.3700e-02, -8.2961e-01, 1.2130e-13, -1.4787e-13, 8.4942e-14, 8.8625e+00, -8.9302e+00, 1.1406e-01, 1.2458e-13, -1.3273e-14, 1.9216e-14, 1.0651e+00, 3.3390e-02, 1.5265e+00, -1.8377e-14, 3.1679e-14, -5.2053e-14, 5.6101e-01, -1.5378e+00, 1.0122e-01, 1.5477e-14, 9.0164e-15, -5.5752e-15, 2.3286e-01, -9.8193e+00, 5.2932e+00, -4.8922e+00, 5.2242e+00, -3.8402e+00, -1.5401e+01, 5.7125e+01, 1.7143e+00, 7.2603e+00, -3.7234e+01, -1.6841e+00, -4.8322e-01, -1.1021e+01, -1.5782e+00, 2.2332e+00, 5.7327e+00, 5.7369e-01, 2.8968e+00, 1.7873e-02, -3.9470e-01, -6.0175e+00, 2.4504e+00, 8.2995e-01,
1.4241e+00, -1.1946e+00, 2.9958e-02, -4.8784e-01, 8.0878e-01, -1.5483e-01, -5.2497e-01, 5.5411e-01, -5.2957e-02, 1.4939e-14, 1.9493e-14, -2.7902e-14, -2.2437e-01, -2.6661e-03, 9.0961e-01, -2.5888e-14, -5.6129e-15, -1.0319e-14, -4.0608e-01, -1.2619e-01, -4.4880e+00, -1.9891e-14, 3.7255e-15, 5.2316e-15, 1.5521e+00, -1.8133e-01, 1.2133e+00, -4.2080e-15, -8.3854e-16, 2.6746e-15, 9.1642e-01, -4.5830e-01, 1.0426e-01, -3.5120e-15, 6.8128e-16, -1.1851e-15, -1.5112e+00, -5.8471e-01, -4.1719e+00, 6.4704e-02, -5.8822e-01, 3.3151e+00, 2.5629e+00, 1.7143e+00, 1.7230e+01, -8.4537e-01, 1.1763e+00, -1.4684e+01, -2.4895e+00, 3.3876e-01, -3.4609e+00, 6.9724e-01, -8.9044e-01, 3.0739e+00, -2.0343e-01, 5.5600e-01, -7.3354e-01, 6.3611e-03, -7.7177e-01, 3.7773e-01,
2.5736e+00, 7.7188e-01, 1.0322e+00, -8.8257e+00, -3.8221e-01, -1.8622e-01, 8.7259e+00, 6.0055e-01, -1.1561e+00, -1.9239e-12, -2.3436e-12, 3.4346e-13, -7.4336e+00, -1.3464e-01, 6.2730e-01, 1.6359e-12, -2.2992e-13, 7.4987e-13, 2.3724e+01, -2.4261e+00, -1.5619e+00, 1.0764e-12, -1.2992e-13, -7.3545e-14, 2.6362e+00, -1.8721e-01, 1.4732e+00, 1.5229e-13, 1.6822e-13, -2.9386e-13, -2.3566e+00, -1.6023e-01, -3.7385e-01, 1.4821e-13, 5.0044e-15, 4.1916e-14, 1.1386e+01, 1.4397e+00, 1.0230e+00, -1.0235e+01, -4.2571e+00, -7.7438e-01, -1.0780e+02, 7.2603e+00, -8.4537e-01, 1.7782e+02, -3.4035e+00, 1.5471e+00, 1.6501e-02, -1.3083e+00, -3.0879e-01, -1.4386e+01, 6.3953e+00, 5.8515e-01, 3.1025e-01, 3.0787e+00, 3.8236e-01, -1.0015e+01, -1.5324e+00, 4.2421e-01,
2.0487e+00, -9.2898e-02, -4.1417e-01, 2.2955e+00, 1.1457e+00, -1.8743e-01, -6.1692e+00, -1.4925e-02, -1.3952e-01, -1.4258e-13, 1.8186e-13, -4.7584e-14, 2.1282e+00, -1.5028e+00, 2.9141e-01, 6.3068e-14, 1.9386e-13, -1.9188e-14, 3.4355e-01, 7.7712e+00, -1.2949e+00, 3.1962e-15, -4.9989e-15, -4.6149e-14, 1.9847e+00, -1.9508e+00, 5.5664e-01, 4.3168e-14, -2.2141e-14, 3.4119e-14, 5.2337e-01, 1.4660e-01, -4.7073e-01, -1.2597e-16, -1.4857e-14, 1.4948e-14, -4.4058e+00, 6.5020e+00, -4.7944e+00, 6.7458e+00, -9.2716e+00, 5.2334e+00, -4.8375e+00, -3.7234e+01, 1.1763e+00, -3.4035e+00, 7.1811e+01, 4.0796e-01, 2.6660e+00, 5.6220e+00, -1.0538e+00, -7.5718e+00, -1.3071e+01, -4.3447e-01, -1.8232e+00, -9.4180e-01, 2.4219e-01, 1.0246e+01, -2.6919e+00, 5.0675e-02,
-9.4984e-01, 6.3221e-01, -3.7659e-02, 9.2968e-01, 7.2373e-02, -2.9795e-01, -1.2268e-01, -1.9615e-01, -2.4214e-01, -6.9171e-16, 5.1964e-15, 2.7691e-14, 3.7235e-01, -6.8984e-01, -5.8005e-01, 1.1031e-14, 2.0862e-14, -3.5023e-15, -4.3109e-02, 2.0904e+00, 1.8077e+00, 1.3683e-14, -2.3165e-15, -9.8936e-15, -5.6087e-01, 4.9280e-03, 1.2927e-01, 8.0310e-15, -1.2428e-15, 1.1175e-15, -4.4121e-01, 1.3043e+00, -4.3244e-01, 2.9712e-15, -2.8161e-15, 8.5515e-16, -9.0558e-02, -4.2834e-01, 4.1604e+00, 8.1216e-01, 1.8232e-01, -5.5185e+00, 7.0452e-01, -1.6841e+00, -1.4684e+01, 1.5471e+00, 4.0796e-01, 2.4605e+01, 2.7648e+00, -1.1204e-02, 1.6898e+00, -2.0735e+00, 5.0195e-01, -5.2167e+00, -2.9844e-01, -2.8139e-01, 2.0100e-01, 1.3844e+00, 5.8768e-01, -8.0720e-01,
-1.8371e+00, 1.8576e-01, 2.2803e-01, 1.0682e-01, 2.4087e-02, -1.1812e+00, 2.0605e+00, 8.8463e-01, -1.5795e-01, -1.6700e-13, 1.0819e-12, 7.4787e-13, 2.5019e+00, -2.2828e-01, 2.9776e-02, 2.9800e-13, 1.0493e-12, -4.1467e-13, 1.0009e+00, 1.5536e+00, -2.0597e-01, 7.0393e-13, 1.4531e-14, -3.2407e-13, -3.0909e+01, -4.1229e-01, 2.1472e-01, 2.6907e-13, 8.5913e-14, 9.5948e-14, 6.3617e+00, -1.9317e-01, 1.0496e-01, 1.1731e-13, -1.2487e-13, 1.8065e-14, -1.5628e+01, -1.6441e+00, -8.7143e-02, 1.0165e+01, 5.4994e+00, -2.0884e-01, -5.1559e+00, -4.8322e-01, -2.4895e+00, 1.6501e-02, 2.6660e+00, 2.7648e+00, 1.6368e+02, -1.6621e+01, 2.4068e+00, -1.2812e+02, 1.7884e+01, 3.5860e-01, -2.0485e+01, 4.3712e-01, -6.0244e-01, 1.7461e+01, -6.8956e-01, 1.5130e+00,
1.6767e-01, -4.5611e-01, 1.2132e+00, -3.0969e+00, 8.9809e-01, -7.5666e-01, 3.1209e+00, -6.7895e-01, 8.2894e-01, -3.9426e-13, -3.3889e-13, -2.1727e-13, 3.6193e+00, -2.0020e+00, 1.0046e-01, -3.9887e-14, -1.4788e-13, 4.6110e-15, 1.7964e+00, 1.2621e+00, -8.7189e-01, -1.1465e-13, 1.6698e-14, 2.3492e-14, 6.5932e+00, -7.2927e+00, 2.3321e-01, -2.6663e-14, -5.6210e-15, 1.0683e-15, -1.4150e+00, 7.2871e-01, -1.3650e-01, -1.3503e-14, 7.2892e-15, 4.8913e-15, 2.4398e+00, 6.0288e-01, 1.0153e+00, -6.3372e-01, -2.0284e+00, -7.0706e-01, -6.4715e-01, -1.1021e+01, 3.3876e-01, -1.3083e+00, 5.6220e+00, -1.1204e-02, -1.6621e+01, 5.6022e+01, 4.4603e+00, 5.8729e+00, -4.1900e+01, -5.0143e+00, 3.0156e+00, -7.8988e+00, 2.3374e-01, 2.1441e+00, 1.3752e+00, -5.5526e-01,
2.6604e-01, 1.3418e-01, 4.4190e-01, -1.6943e-01, 1.5435e-02, -6.8564e-01, 6.9899e-01, 3.6717e-01, 2.7602e-01, -2.3620e-14, 8.5207e-15, -7.9528e-15, 3.2124e-01, -2.5533e-01, 7.3544e-01, -2.8172e-15, 1.2524e-14, -5.8863e-15, -2.7085e+00, -4.0871e-01, 1.5460e+00, -7.3850e-15, 1.4128e-15, -3.6894e-15, 2.7714e-01, -1.0438e+00, -3.7675e+00, 2.4118e-15, -1.1337e-15, 2.8482e-15, 1.6644e+00, -1.4464e-01, 9.5866e-01, 1.3408e-15, -8.7390e-16, 1.7523e-15, 6.5138e-01, 8.9349e-01, -2.2843e+00, -9.2290e-01, -3.1417e-01, 1.6066e+00, 2.1012e-01, -1.5782e+00, -3.4609e+00, -3.0879e-01, -1.0538e+00, 1.6898e+00, 2.4068e+00, 4.4603e+00, 1.4167e+01, -2.8500e-01, -1.4472e+00, -1.3272e+01, -1.8358e+00, 2.8939e-01, -2.4804e+00, 1.3450e+00, -5.1172e-01, 9.3029e-01,
1.1583e+00, 2.0263e-01, -3.8343e-01, 3.7660e+00, -4.5310e-01, -5.2454e-01, -5.5968e+00, 1.2777e+00, 1.9619e-01, 3.6154e-13, -1.0023e-12, -8.4073e-13, -3.6592e+00, 8.7430e-01, 6.9806e-01, -3.8944e-13, -1.2424e-12, 4.9100e-13, -5.1666e+00, -6.2194e-01, 1.0490e+00, -8.9831e-13, -6.5187e-15, 3.9347e-13, 1.8636e+01, -2.5059e+00, -8.4812e-01, -3.2889e-13, -1.1311e-13, -9.9176e-14, -1.0106e+01, 8.7921e-01, 2.9730e-01, -1.5073e-13, 1.6066e-13, -7.2524e-15, 1.4230e+01, -3.5669e+00, 1.4571e+00, -1.5128e+01, 3.0662e+00, -6.2119e-01, 2.8328e+00, 2.2332e+00, 6.9724e-01, -1.4386e+01, -7.5718e+00, -2.0735e+00, -1.2812e+02, 5.8729e+00, -2.8500e-01, 2.2318e+02, -1.8809e+01, -2.3930e+00, 1.2547e+01, -2.0968e+00, 7.1641e-01, -8.7082e+00, 9.5245e+00, 6.7864e-01,
-8.2186e-01, 1.9791e-01, -9.0716e-01, 9.9667e-01, 4.6480e-01, 1.5093e-01, -1.2753e+00, -1.1159e+00, 2.9737e-02, 4.4869e-13, 3.7919e-13, 2.9153e-13, 8.6413e-01, 6.7946e-01, 7.3704e-01, 6.1147e-14, 2.1842e-13, -2.4884e-14, -4.2589e+00, -1.1391e+00, 6.5491e-01, 1.7243e-13, -8.0954e-15, -4.8708e-14, -2.7831e+00, 5.2589e+00, -1.4985e+00, 5.0544e-14, 1.2175e-14, -2.3188e-15, 2.6640e+00, -6.1159e-01, 7.6466e-01, 2.3086e-14, -1.4972e-14, -1.1582e-14, -5.0596e+00, -1.1228e+00, -1.5568e+00, 1.5403e+00, 1.3070e+00, 1.2398e+00, 7.2448e-01, 5.7327e+00, -8.9044e-01, 6.3953e+00, -1.3071e+01, 5.0195e-01, 1.7884e+01, -4.1900e+01, -1.4472e+00, -1.8809e+01, 9.2122e+01, 8.9650e+00, -1.0125e+00, 4.9789e+00, -1.6637e-01, -3.5704e+00, -6.4529e+00, -4.2668e-01,
8.4512e-01, -3.8049e-01, 5.7897e-01, -2.3564e-01, 3.9994e-01, 1.8261e-01, 5.9580e-01, -1.3411e+00, -1.0788e-01, 4.9757e-14, 2.9683e-14, 2.5503e-14, 9.7200e-01, 1.7679e-02, -7.1339e-01, -1.1658e-14, 1.2457e-14, -1.6338e-14, 1.3452e-01, -2.6073e-01, -3.9369e-01, 1.1202e-14, 4.2015e-15, -3.1387e-15, 8.6143e-01, 5.8198e-01, 1.3109e+00, 4.2255e-15, 1.9915e-15, 1.1452e-15, 2.6652e-02, 5.0658e-01, -9.4128e-01, -9.6909e-16, -1.8901e-15, -3.6232e-15, -9.6806e-01, -8.0871e-01, 1.9892e+00, 1.3831e+00, 1.0964e+00, -2.1332e+00, 1.9928e+00, 5.7369e-01, 3.0739e+00, 5.8515e-01, -4.3447e-01, -5.2167e+00, 3.5860e-01, -5.0143e+00, -1.3272e+01, -2.3930e+00, 8.9650e+00, 2.7996e+01, 5.4386e-01, 3.5570e-02, 1.9354e+00, -1.0753e+00, 1.0209e+00, -4.9397e+00,
-2.9931e+00, 5.7522e-01, -1.3704e+00, -4.2039e+00, 1.2377e-01, 1.8362e+00, 2.2216e+00, -1.5711e+00, -1.1967e+00, -4.1505e-14, -3.5753e-13, -9.8578e-14, -1.3656e+00, 4.7862e-01, -1.7053e-01, -1.9273e-13, -4.9858e-13, 6.4656e-14, 2.4051e+00, 3.9802e-01, -1.4710e-01, -9.7895e-14, -5.1001e-14, 1.0765e-13, 4.3686e+00, 8.4888e-01, 1.0930e+00, -1.5716e-13, 1.9571e-14, -3.6231e-14, -3.5122e+01, -7.7447e-01, 2.9743e-01, -2.8897e-14, 4.8239e-14, -4.8330e-14, 5.6489e+00, -3.2505e+00, 1.5649e+00, 1.8289e+00, 2.0227e+00, -1.6199e+00, -5.5683e+00, 2.8968e+00, -2.0343e-01, 3.1025e-01, -1.8232e+00, -2.9844e-01, -2.0485e+01, 3.0156e+00, -1.8358e+00, 1.2547e+01, -1.0125e+00, 5.4386e-01, 1.0636e+02, -8.8930e+00, 3.1176e+00, -7.1226e+01, 1.7443e+01, -4.8427e+00,
-1.9736e+00, -6.1104e-01, 1.6395e+00, 3.4327e+00, 1.2787e+00, -1.5011e+00, -1.9076e+00, -2.0659e+00, 1.4648e+00, 2.3334e-13, 1.2002e-14, 5.3731e-14, -1.5217e+00, -2.5079e+00, 3.7727e-01, 2.7797e-14, 8.3089e-14, 1.1205e-14, -7.9083e-02, -2.2132e+00, 4.1643e-01, 1.4418e-14, -1.0127e-14, -6.4572e-16, 2.4259e+00, -1.2843e+00, -5.3005e-01, 1.0580e-14, -5.6709e-15, -4.4345e-15, 7.0089e+00, -5.8880e+00, 2.0834e-01, 4.5559e-15, 1.5969e-15, -8.6105e-16, 3.0234e+00, 2.1569e+00, -9.3867e-01, -8.4850e-01, -3.7660e-01, 3.3499e-02, 2.1482e+00, 1.7873e-02, 5.5600e-01, 3.0787e+00, -9.4180e-01, -2.8139e-01, 4.3712e-01, -7.8988e+00, 2.8939e-01, -2.0968e+00, 4.9789e+00, 3.5570e-02, -8.8930e+00, 3.8777e+01, 3.4934e+00, -7.1201e+00, -2.5405e+01, -4.7431e+00,
6.6066e-02, 1.4797e-01, 8.7381e-01, 1.9456e-01, -1.8316e-01, -3.2054e-01, -9.8541e-01, -3.1149e-01, 1.5769e-01, 3.1057e-14, -9.5951e-15, 4.9748e-15, -1.0113e-01, -7.3305e-01, 2.3064e-02, -8.3650e-15, -1.1428e-14, 1.3082e-15, 3.1056e-02, -4.8114e-01, 1.5851e-01, -3.6528e-15, -1.8908e-15, 5.9658e-15, -1.6274e+00, 5.1001e-02, 4.2967e-01, -6.3231e-15, -1.1110e-15, -1.6606e-15, -2.1737e+00, -1.3848e+00, -4.2563e+00, -1.2923e-15, 2.4540e-15, -2.1567e-15, 6.4176e-01, -9.3049e-01, -1.8061e-01, -3.3619e-02, 5.3030e-01, -7.9949e-02, 4.1037e-01, -3.9470e-01, -7.3354e-01, 3.8236e-01, 2.4219e-01, 2.0100e-01, -6.0244e-01, 2.3374e-01, -2.4804e+00, 7.1641e-01, -1.6637e-01, 1.9354e+00, 3.1176e+00, 3.4934e+00, 1.3970e+01, -3.3360e+00, -9.1199e-01, -1.1086e+01,
1.6736e+00, 7.4774e-01, 9.7396e-01, -5.3430e+00, 2.3179e-01, -4.1772e-01, 1.2451e+01, -2.4656e+00, 8.1418e-01, -3.6638e-13, 4.0253e-13, -6.8835e-14, 1.6020e+00, 3.0654e-01, 4.2270e-02, 1.6434e-13, 5.0181e-13, -1.5799e-13, -1.4037e+00, 1.4640e+00, 1.6570e-01, -7.0713e-15, 1.0857e-13, -1.5902e-13, -3.9141e+00, -2.0468e+00, -3.3928e-01, 2.0214e-13, -3.1959e-14, 5.5231e-14, 1.2289e+01, 8.0654e-01, -8.9671e-01, 1.8336e-14, -6.2282e-14, 7.2179e-14, -7.1797e+00, 2.1508e+00, -8.5795e-01, 5.3660e+00, -4.4028e+00, 8.5763e-01, 1.2414e+01, -6.0175e+00, 6.3611e-03, -1.0015e+01, 1.0246e+01, 1.3844e+00, 1.7461e+01, 2.1441e+00, 1.3450e+00, -8.7082e+00, -3.5704e+00, -1.0753e+00, -7.1226e+01, -7.1201e+00, -3.3360e+00, 1.6283e+02, -1.3986e+01, 4.3736e+00,
6.4586e-01, 4.7357e-01, 6.6805e-01, 1.9451e-01, -1.0570e+00, 3.5720e-01, -1.0354e+00, 1.7461e+00, -4.7892e-01, -1.3093e-13, -1.8592e-14, -4.7755e-14, -3.3364e-01, 8.3636e-02, 1.5973e-01, -7.5558e-14, -1.6303e-13, 2.1920e-14, 2.0486e+00, -4.0136e-01, 1.2797e-01, -2.4346e-14, -1.4299e-14, 3.6601e-14, 2.1045e-01, -2.8676e-01, -8.3606e-04, -4.9569e-14, 8.6551e-15, -8.1873e-16, -3.2326e+00, 3.7569e+00, -3.5780e-01, -1.1974e-14, 9.8668e-15, -1.1167e-14, 2.7640e-01, -1.4821e+00, 4.9548e-01, 1.1620e+00, 1.5243e+00, -6.4090e-01, -8.1959e-01, 2.4504e+00, -7.7177e-01, -1.5324e+00, -2.6919e+00, 5.8768e-01, -6.8956e-01, 1.3752e+00, -5.1172e-01, 9.5245e+00, -6.4529e+00, 1.0209e+00, 1.7443e+01, -2.5405e+01, -9.1199e-01, -1.3986e+01, 5.9989e+01, 7.5698e+00,
2.3043e-01, 5.5484e-01, 1.1400e-01, -1.7848e-01, 3.2552e-01, 8.7164e-02, 6.9329e-01, -4.3360e-01, -6.4110e-01, -5.6039e-14, 9.7945e-15, -1.0847e-14, 4.8095e-01, -4.1551e-02, 4.2190e-01, 1.2178e-14, 7.3305e-15, 1.8905e-15, 8.2318e-01, 7.2812e-01, -3.5199e-01, 7.6510e-15, 1.2493e-15, -6.9580e-15, 9.1505e-01, -3.9556e-01, 2.0539e-01, 6.9328e-15, 2.3752e-15, 1.8643e-15, 1.7004e+00, 7.0988e-01, 1.8041e+00, 1.5015e-15, -2.9545e-15, 2.6825e-15, -8.5708e-01, 2.9178e-01, -2.4911e-01, 7.2508e-01, -2.6109e-02, -2.3809e-01, -2.2875e-01, 8.2995e-01, 3.7773e-01, 4.2421e-01, 5.0675e-02, -8.0720e-01, 1.5130e+00, -5.5526e-01, 9.3029e-01, 6.7864e-01, -4.2668e-01, -4.9397e+00, -4.8427e+00, -4.7431e+00, -1.1086e+01, 4.3736e+00, 7.5698e+00, 2.4225e+01};
    handm.pose_prior_A_.resize(60, 60);
    std::copy(A_data, A_data + 3600, handm.pose_prior_A_.data());
    handm.pose_prior_A_.transposeInPlace();

    file.close();

    //convert quad mesh to triangles
    for (int r = 0; r < F_quad.rows(); ++r)
    {
        handm.F_(2 * r, 0) = F_quad(r, 0) -1; //Face index is saved by 1-based 
        handm.F_(2 * r, 1) = F_quad(r, 1) - 1;
        handm.F_(2 * r, 2) = F_quad(r, 2) - 1;

        handm.F_(2 * r +1, 0) = F_quad(r, 2) - 1;
        handm.F_(2 * r +1, 1) = F_quad(r, 3) - 1;
        handm.F_(2 * r +1, 2) = F_quad(r, 0) - 1;
    }

    handm.m_bInit = true;
}

// Reconstruct shape with pose & coefficients (no translation)
void reconstruct_joints_mesh(const HandModel &handm,
    const double *trans_,
    const double *coeffs,
    const double *pose,
    double *outJoints,
    double *out_v,
    MatrixXdr &dJdc,
    MatrixXdr &dJdP,
    const int regressor_type,
    bool euler)
{
    using namespace Eigen;
    Map< const Matrix<double, 3, 1> > Trans(trans_);
    Map< const Matrix<double, Dynamic, 1> > c(coeffs, HandModel::NUM_SHAPE_COEFFICIENTS);
    Map< const Matrix<double, Dynamic, Dynamic> > p(pose, HandModel::NUM_JOINTS,3);


    Map< Matrix<double, Dynamic, Dynamic, RowMajor> >
        outJ(outJoints, HandModel::NUM_JOINTS, 3);
    dJdc.resize(HandModel::NUM_JOINTS * 3, 3 * HandModel::NUM_JOINTS);
    dJdP.resize(HandModel::NUM_JOINTS * 3, 3 * HandModel::NUM_JOINTS);
    const int num_t = (HandModel::NUM_JOINTS) * 3 * 4 * 2;      //note *2
    Matrix<double, Dynamic, 3 * HandModel::NUM_JOINTS, RowMajor> dTdc(num_t, 3 * HandModel::NUM_JOINTS);
    Matrix<double, Dynamic, 3 * HandModel::NUM_JOINTS, RowMajor> dTdP(num_t, 3 * HandModel::NUM_JOINTS);

    VectorXd transformsNJoints(3 * HandModel::NUM_JOINTS * 4 * 2);      //Transform + Joints
    Map< Matrix<double, 3 * HandModel::NUM_JOINTS, 4, RowMajor> > Tf(transformsNJoints.data());
    Map< Matrix<double, 3 * HandModel::NUM_JOINTS, 4, RowMajor> > Joints(transformsNJoints.data() + 3 * HandModel::NUM_JOINTS * 4);

    ceres::AutoDiffCostFunction<PoseToTransformsHand,
        (HandModel::NUM_JOINTS) * 3 * 4 * 2,        //Transform +  joints
        (HandModel::NUM_JOINTS) * 3,
        (HandModel::NUM_JOINTS) * 3> p2t(new PoseToTransformsHand(handm, euler));
    // ForwardKinematics forward(handm);
    const double * parameters[2] = { coeffs, pose };
    double * residuals = transformsNJoints.data();
    double * jacobians[2] = { dTdc.data(), dTdP.data() };
    p2t.Evaluate(parameters, residuals, jacobians);
    // forward.forward(coeffs, pose, residuals);

    // std::cout << "Joints\n" << Joints << std::endl;

    for (int idji = 0; idji < HandModel::NUM_JOINTS; idji++)
    {
        int idj = handm.m_jointmap_pm2model(idji);      //mine -> matlab
        outJ(idji, 0) = Joints(idj * 3 + 0, 3);
        outJ(idji, 1) = Joints(idj * 3 + 1, 3);
        outJ(idji, 2) = Joints(idj * 3 + 2, 3);

        if (trans_ != NULL)
        {
            outJ(idji, 0) += Trans(0, 0);
            outJ(idji, 1) += Trans(1, 0);
            outJ(idji, 2) += Trans(2, 0);
        }
    }

    lbs_hand(handm, transformsNJoints.data(), out_v);
    Map< Matrix<double, HandModel::NUM_VERTICES, 3, RowMajor> > outV(out_v);

    //Transforming Vertices
    if (trans_ != NULL)
    {
        // Map< Matrix<double, HandModel::NUM_VERTICES, 3, RowMajor> > outV(out_v);
        for (int r = 0; r < outV.rows(); ++r)
        {
            outV(r, 0) += Trans(0, 0);
            outV(r, 1) += Trans(1, 0);
            outV(r, 2) += Trans(2, 0);
        }
    }

    if (regressor_type == 1)
    {
        // update the wrist
        outJ.row(0) = handm.STB_wrist_reg * outV;
    }
}

void lbs_hand(const HandModel &handm, double* T, double* out_v_)
{
    using namespace Eigen;
    Map< Matrix<double, 3 * HandModel::NUM_JOINTS, 4, RowMajor> > Tv(T);
    Map< Matrix<double, HandModel::NUM_VERTICES, 3, RowMajor> > outV(out_v_);

    Map< const Matrix<double, Dynamic, Dynamic, RowMajor> >
        Vs(handm.V_.data(), HandModel::NUM_VERTICES, 3);

    for (int idv = 0; idv<HandModel::NUM_VERTICES; idv++)
    {
        outV(idv, 0) = 0;
        outV(idv, 1) = 0;
        outV(idv, 2) = 0;
        for (int idj = 0; idj<HandModel::NUM_JOINTS; idj++)
        {
            if (handm.W_(idv, idj))
            {
                double w = handm.W_(idv, idj);
                for (int idd = 0; idd<3; idd++)
                {
                    outV(idv, idd) += w*Vs(idv, 0)*Tv(idj * 3 * 4 + idd * 4 + 0);
                    outV(idv, idd) += w*Vs(idv, 1)*Tv(idj * 3 * 4 + idd * 4 + 1);
                    outV(idv, idd) += w*Vs(idv, 2)*Tv(idj * 3 * 4 + idd * 4 + 2);
                    outV(idv, idd) += w*Tv(idj * 3 * 4 + idd * 4 + 3);

                }
            }
        }
    }
}

void reconstruct_joints(const HandModel &handm,
    const double *trans_,
    const double *coeffs,
    const double *pose,
    double *outJoints,
    bool euler)
{
    using namespace Eigen;
    Map< const Matrix<double, 3, 1> > Trans(trans_);
    Map< const Matrix<double, Dynamic, 1> > c(coeffs, HandModel::NUM_SHAPE_COEFFICIENTS);
    Map< const Matrix<double, Dynamic, Dynamic> > p(pose, HandModel::NUM_JOINTS,3);

    Map< Matrix<double, Dynamic, Dynamic, RowMajor> >
        outJ(outJoints, HandModel::NUM_JOINTS, 3);

    VectorXd transformsNJoints(3 * HandModel::NUM_JOINTS * 4 * 2);      //Transform + Joints
    Map< Matrix<double, 3 * HandModel::NUM_JOINTS, 4, RowMajor> > Tf(transformsNJoints.data());
    Map< Matrix<double, 3 * HandModel::NUM_JOINTS, 4, RowMajor> > Joints(transformsNJoints.data() + 3 * HandModel::NUM_JOINTS * 4);

    ceres::AutoDiffCostFunction<PoseToTransformsHand,
        (HandModel::NUM_JOINTS) * 3 * 4 * 2,        //Transform +  joints
        (HandModel::NUM_JOINTS) * 3,
        (HandModel::NUM_JOINTS) * 3> p2t(new PoseToTransformsHand(handm, euler));
    // ForwardKinematics forward(handm);
    const double * parameters[2] = { coeffs, pose };
    double * residuals = transformsNJoints.data();
    p2t.Evaluate(parameters, residuals, NULL);

    for (int idji = 0; idji < HandModel::NUM_JOINTS; idji++)
    {
        int idj = handm.m_jointmap_pm2model(idji);      //mine -> matlab
        outJ(idji, 0) = Joints(idj * 3 + 0, 3);
        outJ(idji, 1) = Joints(idj * 3 + 1, 3);
        outJ(idji, 2) = Joints(idj * 3 + 2, 3);

        if (trans_ != NULL)
        {
            outJ(idji, 0) += Trans(0, 0);
            outJ(idji, 1) += Trans(1, 0);
            outJ(idji, 2) += Trans(2, 0);
        }

    }
}

int write_hand_obj(const CMeshModelInstance& mesh, const char* output_filename, const bool flip)
{
    assert(mesh.m_meshType == CMeshModelInstance::MESH_TYPE_LHAND);
    std::ofstream f(output_filename);
    if (!f.good())
    {
        std::cerr << "Cannot write hand mesh to " << output_filename << std::endl;
        return 1;
    }
    for (auto i = 0u; i < HandModel::NUM_VERTICES; i++)
        f << "v " << (flip ? (-mesh.m_vertices[i].x / 100) : (mesh.m_vertices[i].x / 100)) << " "
                 << mesh.m_vertices[i].y / 100 << " "
                 << mesh.m_vertices[i].z / 100 << std::endl;

    for (auto i = 0u; i < mesh.m_face_vertexIndices.size() / 3; i++)
        f << "f " << mesh.m_face_vertexIndices[3 * i + 0] + 1 << " "
                 << mesh.m_face_vertexIndices[3 * i + 1] + 1 << " "
                 << mesh.m_face_vertexIndices[3 * i + 2] + 1 << std::endl;
    f.close();
    return 0;
}

}